package com.dewod.producesales.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.dewod.producesales.adapter.CabinetSnAdapter;
import com.dewod.producesales.viewmodel.SubmitViewModel;

public class CabinetSnFragment extends Fragment {

//    private CabinetSnAdapter adapter;
//    private SubmitViewModel viewModel;
//
//    @Nullable
//    @Override
//    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        RecyclerView recyclerView = new RecyclerView(requireContext());
//        recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
//        return recyclerView;
//    }
//
//    @Override
//    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
//        super.onViewCreated(view, savedInstanceState);
//        RecyclerView recyclerView = (RecyclerView) view;
//        viewModel = new ViewModelProvider(requireActivity()).get(SubmitViewModel.class);
//
//        viewModel.cabinetSnList.observe(getViewLifecycleOwner(), cabinetSns -> {
//            if (adapter == null) {
//                adapter = new CabinetSnAdapter(cabinetSns);
//                recyclerView.setAdapter(adapter);
//            } else {
//                adapter.updateData(cabinetSns);
//            }
//        });
//    }

}
